package com.zq.mycloud.gateway.controller;

import com.zq.mycloud.core.respones.GeneralResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：zhang qiang
 * @package :com.zq.mycloud.gateway.controller
 * @date ：Created in 2020/12/11 下午7:07
 * @description：
 * @modified By：
 * @version: $
 */
@RestController
@RequestMapping("/error/")
public class FallbackController {

    @GetMapping("/fallback/{routeId}")
    public GeneralResult fallback(@PathVariable("routeId") String routeId) {
        GeneralResult result = new GeneralResult();
        result.setMessage("服务：" + routeId + "正忙，进行熔断处理");
        return result;
    }
}
